<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 初始化
        // let m = new Map();

        let m = new Map([['name', 'jack'],['age',18]]);

        m.set('name','rose');
        m.set('birth','1998');

        m.set({},1);
        m.set(undefined,1);
        m.set(1,1);
        m.set('1',1);
        m.set(['jack','rose'],1);

        console.log(m);
        console.log(m.size);

        console.log('name:',m.get('name'));
        console.log('has age:',m.has('age'));

        m.delete('name');
        console.log(m);
        
        m.clear();
        console.log('清空后size：',m.size);
    </script>
</body>
</html>